﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;

namespace EEDS.Core
{
    public sealed class RgbPaletteConverter : RelationshipPaletteConverter
    {
        public override int ColourRelationship(Color colourA, Color colourB)
        {
            int temp;
            int relationship;

            temp = colourA.R - colourB.R;
            if (temp < 0)
                temp = -temp;
            relationship = temp;

            temp = colourA.G - colourB.G;
            if (temp < 0)
                temp = -temp;
            relationship += temp;

            temp = colourA.B - colourB.B;
            if (temp < 0)
                temp = -temp;
            relationship += temp;

            return relationship;
        }

        private RgbPaletteConverter() { }
        public static readonly RgbPaletteConverter Instance = new RgbPaletteConverter();
    }
}
